{template "business","head"}
 {template "business","left"}
 <script type="text/javascript">
   		function add_message(){
   			var name = $('#name').val();
   			var phone = $('#phone').val();
   			var content = $('#content').val();
   			var code = $('#code').val();
   			if(name==''){
   				alert('请填写联系人名字');
   				return false;
   			}
   			if(phone==''){
   				alert('请填写联系电话');
   				return false;
   			}
   			if(content==''){
   				alert('请填写咨询内容');
   				return false;
   			}
   			if(code==''){
   				alert('请填写验证码');
   				return false;
   			}
   		}
		function reply(id){
		var content = $('#rcontent'+id).val();
		if(content==''){
			alert('请填写回复内容');
			$('#rcontent').focus();
			return false;
		}else if(content.length>255){	
			alert('回复的内容不能超过255个字符');	
			return false;
		}
			$.post("index.php?m=content&c=company&a=reply_message", {
			content :content,
			messageid:id,
			dosubmit:1
			
		}, function(data) {
				if(data.id>0){
					var html = '<span class="span01">回答:</span><span class="span02">	'+data.content+'</span>';
					$('#noreply'+data.id).html(html);
					$('#reply_box'+data.id).hide();
					$('#replyword'+data.id).hide();
					alert('回复成功');
					return false;
				}else{
					alert('回复失败请重试');
					return false;
				}
				
		
			
		}, "json");
		}
		function replyit(id){
			
			var d = document.getElementById('reply_box'+id).style.display;
			
			if(d=='none'){
				$('#reply_box'+id).show();
			}else{
				$('#reply_box'+id).hide();
			}
			
		}
   </script>
    <div class="r">
      <div class="r02_c">
        <div class="r02_title"><font>装饰杂谈</font><span><a href="{APP_PATH}index.php?m=content&c=business&a=index&uid={$_GET[uid]}">首页</a>>联系我们</span></div>
        <div class="r02_titler"></div>
        <div class="r02_contant">
          <div class="r02_content01">
		  <div class="lxfs sj_lxfs">
			<span><label>地址：</label><span class="ss02 sj_ss02">{$b_data[address]}&nbsp;</span></span>
			<span><label>电话：</label><span class="ss02 sj_ss02">{$b_data[phone]}&nbsp;</span></span>
			<span><label>邮箱：</label><span class="ss02 sj_ss02">{$b_data[email]}&nbsp;</span></span>
			<span><label>传真：</label><span class="ss02 sj_ss02">{$b_data[fax]}&nbsp;</span></span>
			<span><label>QQ：</label><span class="ss02 sj_ss02">{$b_data[qq]}&nbsp;</span></span>
			<span><label>MSN：</label><span class="ss02 sj_ss02">{$b_data[msn]}&nbsp;</span></span>
			</div>
		  	<div class="lyzx">
				<form action="{APP_PATH}index.php?m=content&c=business&a=message" method="post">
		  		<input type="hidden" name="uid" value="{$_GET['uid']}">
				<span><label>联系人：</label><input name="name" id="name" type="text" class="k" /></span>
				<span><label>联系方式：</label><input name="phone" id="phone" type="text" class="k" />&nbsp; （仅提供给伱所留言的公司查询）</span>
				<span><label>咨询内容：</label><textarea name="content" id="content" cols="" rows="" class="k1"></textarea></span>
				<span><label>验证码：</label><input name="code" id="code" type="text" class="k2" />　{form::checkcode('code_img', '4', '14', 84, 24)}</span>
				<input name="dosubmit" onclick="return add_message();" type="submit" style="margin-left:200px;  font:bold 14px '宋体';" class="inputbutton4" value="提交" />
				</form>
				{loop $message_data $r}
			<dl>
			<form action="">
				<dt><span><p>{if $_GET['messageid']>0}<a href="{APP_PATH}index.php?m=content&c=company&a=message&companyid={$_GET[companyid]}">查看全部留言</a>{/if}</span></p></dt>
				<dt><span>{$r['name']}</span><tt>{date('Y-m-d H:i',$r[addtime])} </tt>{if $reply}<a onclick="return confirm('确定要删除吗?')" href="{APP_PATH}index.php?m=content&c=company&a=del_message&companyid={$_GET[companyid]}&messageid={$r[messageid]}" class="tt01">删除</a>{if $r['rid']==''}<a href="javascript:void(0);" onclick="replyit({$r['messageid']})" class="tt01" id="replyword{$r['messageid']}">回复</a>{/if}{/if}</dt>
				<dd><span class="span01">问题:</span><span class="span02">	{$r['content']}</span>
				</dd>
				{if $r['rcontent']!=''}
				<dd class="dd01"><span class="span01">回答:</span><span class="span02">	{$r['rcontent']}</span>
				</dd>
				{else}
				<dd class="dd01" id="noreply{$r['messageid']}"><span class="span01">回答:</span><span class="span02">尚未回复</span>
				</dd>
				{/if}
				{if $r['rid']==''}
				<b style="display:none" id="reply_box{$r['messageid']}">
				<dd>
				<textarea name="" cols="" id="rcontent{$r['messageid']}" rows="" style="width:300px;"></textarea>
				</dd>
				<input name="" type="button" onclick="return reply({$r['messageid']});" class="inputbutton16 margin-left"  value="提交回复" />
				</b>
				{/if}
		</form>
			</dl>
			{/loop}
			</div>
			
			<div class="bottom">
				<div class="sabrosus">{$pages2}</div>
				</div>
			</div>
		  <div class="r02_cbottoml"></div>
          <div class="r02_cbottom"></div>
          <div class="r02_cbottomr"></div>
        </div>
		
     </div>   
    </div>
  </div>

 {template "business","footer"}
